const Search_action = (name,page )=> {
    const formdata = new FormData();
    formdata.append('name', name);
    formdata.append('page', page);
   
    return dispatch => {
        let url = 'http://www.h5weixin.club:8000/search'
        fetch(url, {
            method: 'POST',
            mode: 'cors',
            body: formdata
        }).then(res => {
            return res.json()
        }).then(res => {
            if (res.code === 200) {
                dispatch({
                    type: 'GET_SEARCH_DATA',
                    data: res
                })
            }
        }).catch(err => {
            console.log(err)
        })
    }
}

export default Search_action